<extend name="Public/base"/>
<block name="content">
<h3 class="col-md-8">服务器管理</h3>
<div class="row">
    <div class="col-lg-12">
    	<div class="panel panel-default">
       		<div class="panel-heading ">服务器列表
       			<div class="btn-group pull-right">
	       			<a class="btn btn-labeled btn-success" href="<{:U('add')}>">新增</a>               
	                <a class="btn btn-labeled btn-danger" href="javascript:void(0);">删除</a>
	         	</div>      			
       		</div>
    		<div class="table-responsive">
        		<table class="table table-striped table-bordered table-hover">           
            		<thead>
                		<tr>
                			<th style="width: 5%" class="check-all">
                          		<div data-toggle="tooltip" data-title="全选" class="checkbox c-checkbox">
                             		<label>
                                		<input type="checkbox">
                                		<span class="fa fa-check"></span>
                             		</label>
                          		</div>
                       		</th> 
                            <th>ID</th>
            				<th>服务器名称</th>
            				<th>服务器地址</th>
                         	<th>添加时间</th>
                         	<th class="text-center">操作</th>
                    	</tr>
                	</thead>
                    <tbody>
                    	<notempty name="list">
                    	<volist name="list" id="data" key="k">
                      	<tr>
                        	<td>
                          		<div class="checkbox c-checkbox">
                             		<label>
                                	<input type="checkbox" class="ids" value="<{$data.id}>" name="id[]">
                                	<span class="fa fa-check"></span>
                             		</label>
                          		</div>
                       		</td>				
        					<td><{$data.id}></td>
        					<td class='m-name'><{$data.name}></td>
        					<td class=''><{$data.url}></td>
                        	<td><{$data.create_time|time_format='Y-m-d'}></td>
                    		<td class="text-center">
                    			<if condition="C('DT_SERVER_ID') eq $data.id ">
                    				<a class="btn btn-labeled btn-danger btn-sm ajax-set " href="<{:U('defaultServer?id=0')}>">取消默认</a>                    				
                    			<else />
                    				<a class="btn btn-labeled btn-success btn-sm ajax-set " href="<{:U('defaultServer?id='.$data['id'])}>">默认</a>
                    			</if>
	                            <a class="btn btn-labeled btn-sm " href="<{:U('mod?id='.$data['id'])}>">修改</a>
	                            <a class="btn btn-labeled btn-sm btn-danger btn-del" url="<{:U('del?id='.$data['id'])}>">删除</em></a>
                         	</td>
                      	</tr>
                      	</volist>
        				<else/>
        				<td colspan="10" class="text-center">暂时还没有内容! </td>
        				</notempty>
                    </tbody>
                </table>
    		</div>
    		<!-- 结束 表格 -->
    		<div class="panel-footer">
				<div class="row">
					<ul class="pagination">
					<{$_page}>
					</ul>
				</div>
            </div>    		
    	</div>
	</div>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav("<{:U('Songs/index')}>","<{:U('Server/index')}>")
$(function(){
	$('.ajax-set').click(function () {
		var url = $(this).attr('href');
		$.ajax({ 
			type: "POST",
			url:url, 
			success: function(data){
				if(data.status == 1){
					topAlert(data.info,'success');
					window.location.reload(); // 刷新页面
				}else{
					topAlert(data.info);
				}
			}			
		});
		return false;
	})
})
</script>
</block>	


